<template>
	<view class="my">
		 <view class="box">
		 	<view class="my-list">
				<view class="wo">我的</view>
				<view class="dd" @click="setting">. . .</view>
			</view>
			<view class="login-list">
				<view class="login-img">
					<view class="img"></view>
				</view>
				<view class="login-title">
					<view class="top" @click='login'>{{token?username :'立即登录'}}</view>
					<view class="bottom">登录解锁更多功能</view>
				</view>
			</view>
			<view class="navs-list">
				<view class="navs">
					<ul class='navs-ul'>
						<li>订单</li>
						<li>消息</li>
						<li>收藏</li>
						<li>在学</li>
					</ul>
				</view>
			</view>
		 </view>
		 <view class="foot-box">
		 	<view class="a1"></view>
			<view class="a2"></view>	
			<view class="a3"></view>
		 </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				token:'',
				username:''
			};
		},
		
		onLoad(){
			this.username = uni.getStorageSync('username')
			this.token = uni.getStorageSync('token')    // 小程序切入前台时触发调用
		},
		onShow(){
			this.username = uni.getStorageSync('username')
			this.token = uni.getStorageSync('token')    // 小程序切入后台时触发调用
		},
		methods:{
			//点击立即登录 跳转到登录页面
		login(){
			uni.navigateTo({
				url:'../login/login'
			})
		},
		
		// 点击。。。跳转页面
		setting(){
			uni.navigateTo({
				url:'../setting/setting'
			})
		}
		}
	}
</script>

<style lang="scss">
.box{
	width: 100%;
	height: 480rpx;
	background-color: #5ccc84;
	display: flex;
	flex-direction: column;
	border-radius: 0 0 120rpx 120rpx ;
	.my-list{
		flex: 0.7;
		display: flex;
		margin-top: 15rpx;
		.wo{
			flex: 9;
			text-align: center;
			color: white;
		}
		.dd{
			flex: 1;
			text-align: center;
			font-weight: 600;
			color: white;
		}
	}
	.login-list{
		flex: 5;
		display: flex;
		margin-top: 30rpx;
		.login-img{
			flex: 3.5;
			display: flex;
			justify-content: center;
			align-items: center;
			.img{
				width:160rpx;
				height: 160rpx;
				background-color: white;
				border-radius: 50%;
			}
		}
		.login-title{
			flex: 8;
			display: flex;
			flex-direction: column;
			.top{
				flex: 2;
				font-size: 35rpx;
				color: white;
				font-weight: 500;
			    box-sizing: border-box;
				margin: 20rpx 15rpx;
				
			}
			.bottom{
				flex: 3;
				color: white;
				font-weight: 500;
			    font-size: 28rpx;
				margin: 0 15rpx;
				margin-top: -30rpx;
			}
		}
	}
	.navs-list{
		 flex: 6;
		 // background-color: brown;
		 display: flex;
		 justify-content: center;
		 align-items: center;
		 .navs{
			 width: 90%;
			 height: 140rpx;
			 background-color: white;
			 margin-bottom:-40rpx;
			 border-radius: 10rpx;
			.navs-ul{
				display: flex; 
				flex-direction: row;
				justify-content:space-between;
				text-align: center;
				line-height: 160rpx;
				list-style: none;
				li{
					width: 24%;
					font-size: 25rpx;
					color: #ccc;
				}
			 }
		 }
	}
.foot-box{
	width: 100%;
	height: 400rpx;
	background-color: pink;
}
}
</style>
